package cgb2202.recruitment01.mapper;

import cgb2202.recruitment01.entity.Admin;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AdminMapper {
    @Insert("insert into admin values(null,#{name},#{password}")
    public void insert(Admin admin);

    @Select("select * from admin where name=#{name}")
    Admin selectByName(String name);

    @Update("update user set password = #{password} where id = #{id}")
    public void changePassword(Admin admin);

    @Delete("delete from user where id=#{id}")
    public void deleteById(Integer id);

}